package tgc.edu.yzy.service;

import java.util.Optional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import tgc.edu.yzy.custom.CommonService;
import tgc.edu.yzy.entity.Bj;
import tgc.edu.yzy.repository.BjRepository;

@Service
public class BjService extends CommonService<Bj, Integer>{
	@Autowired
	private BjRepository bjdao;

	public Bj findById1(Integer id) {
		Optional<Bj> bj = bjdao.findById(id);
		if(bj.isPresent()){
			return bj.get();
		}
		return null;
	}

	public Bj findByBjname(String bjname) {
		return bjdao.findByBjname(bjname);
	}
}
